using UnityEngine;
using UnityEditor;
using System.IO;
public class Tools : object {

    // This is a tools will clean cache what is created by WWW.LoadFromCacheOrDownload.
    // http://unity3d.com/support/documentation/ScriptReference/WWW.LoadFromCacheOrDownload.html
    [MenuItem("Tools/Resources/Clean Cached AssetBundle")]
    static void CleanCachedAssetBundle() {
        if (Caching.CleanCache()) {
            //PlayerPrefs.DeleteKey(UserContext.ASSET_BUNDLE_CACHED_VERSION);
            PlayerPrefs.Save();
            Debug.Log("Clean successfully!");
        } else {
            Debug.Log("Clean failed.");
        }
    }

    [MenuItem("Tools/Clean All PlayerPrefs")]
    static void CleanAllPlayerPrefs() {
        PlayerPrefs.DeleteAll();
        PlayerPrefs.Save();
        Debug.Log("Clean successfully!");
    }
    [MenuItem("Tools/Resources/Clean Updated Resources")]
    static void CleanCachedResource() {
        System.IO.Directory.Delete(Application.persistentDataPath,true);

    }

}
